﻿using Abp.AspNetCore.Configuration;
using Abp.AutoMapper;
using Abp.Modules;
using Abp.Reflection.Extensions;
using ARchGL.Platform.Electrocar.Application;
using ARchGL.Platform.Electrocar.Authorization;
using ARchGL.Platform.Electrocar.Localization;

namespace ARchGL.Platform.Electrocar
{
    /// <summary>
    /// 
    /// </summary>
    public class PluginOneModule : AbpModule
    {
        /// <summary>
        /// 
        /// </summary>
        public override void PreInitialize()
        {            
            Configuration.Modules.AbpAspNetCore().CreateControllersForAppServices(typeof(PluginOneModule).GetAssembly());
            Configuration.Modules.AbpAutoMapper().Configurators.Add(CustomDtoMapper.CreateMappings);
            Configuration.Authorization.Providers.Add<AppAuthorizationProvider>();//注册权限
            Configuration.MultiTenancy.IsEnabled = false;//是否启用多租户
            //LocalizationConfigurer.Configure(Configuration.Localization);//注册本地化资源
            
        }

        /// <summary>
        /// 
        /// </summary>
        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(typeof(PluginOneModule).GetAssembly());
        }
    }
}
